#include "dominion.h"
#include "dominion_helpers.h"
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include "rngs.h"

void checkFullDeck(int p, int c, struct gameState *post) {
  int r;
    
  r = fullDeckCount (p, c, post);
  assert (r == 0);
}

int main () {
  int testNum = 10;
  int i, n, r, p, c, deckCount, discardCount, handCount;

  int k[10] = {adventurer, council_room, feast, gardens, mine,
         remodel, smithy, village, baron, great_hall};

  struct gameState G;

  printf ("Testing fullDeck.\n");

  printf ("RANDOM TESTS.\n");

  SelectStream(2);
  PutSeed(3);

  for (n = 0; n < testNum; n++) {
    for (i = 0; i < sizeof(struct gameState); i++) {
      ((char*)&G)[i] = floor(Random() * 256);
    }
    p = floor(Random() * 2);
    c = floor(Random() * 10);
    G.deckCount[p] = floor(Random() * MAX_DECK);
    G.discardCount[p] = floor(Random() * MAX_DECK);
    G.handCount[p] = floor(Random() * MAX_HAND);
    checkFullDeck(p, c, &G);
  }

  printf ("(Ran %d tests)\nALL TESTS OK\n", testNum);

  exit(0);
}